<template>
  <div id="type">
      <h1>请选择您的商户号进入</h1>
      <div class="main">
        <div class="apliy" v-if="type.includes(1)" @click="handle(1)">银行卡、支付宝</div>
        <div class="tencent" v-if="type.includes(2)" @click="handle(2)">公众号</div>
      </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
        type:[],
    };
  },
  activated() {
    this.getData();
  },
  mounted() {
    this.getData();
  },
  methods: {
    handle(register_type_Id) {
      if(this.$route.query.path){
        this.$router.push(this.fun.getUrl("worker_withdraw",{id:register_type_Id,path:this.$route.query.path}));
      }else{
        this.$router.push(this.fun.getUrl("worker_withdraw",{id:register_type_Id}));
      }
    },
    getData() {
      $http.get("plugin.worker-withdraw.frontend.register.baseData").then(res => {
        if (res.data.register_type.length >= 1) {
          this.type = res.data.register_type;
        }
      });
    }
  }
};
</script>

<style lang="scss" scoped>
#type {
  background-color: #fff;
  height: 90vh;
  font-size: 1.2rem;
}

h1 {
  text-align: left;
  padding: 1rem 0 1rem 1rem;
}

.main {
  padding: 0 1rem;
}

.apliy,
.tencent {
  color: #fff;
  width: 24.85rem;
  height: 7.571rem;
  line-height: 7.571rem;
  text-align: left;
  padding-left: 1.9285rem;
  border-radius: 0.7rem;
  width: 100%;
}

.apliy {
  background-color: #ffa040;
  margin-bottom: 2rem;
}

.tencent {
  background-color: #5ca2ff;
}
</style>
